
/*
CCP
7.4 Write methods to implement the multiply, subtract, and divide operations for 
integers. Use only the add operator.
*/

#include <iostream>
#include <stdio.h>
#include <string>
#include <string.h>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <map>
#include <list>
#include <algorithm>
#include <functional>
#include <unordered_map>
using namespace std;

int Sub(int a,int b)
{
	int ans = a+(-b);
	return ans;
}

int Mul(int a,int b)
{
	if(a > b)swap(a,b);
	int ans = 0;
	for(int i=1;i<=a;i++)
		ans += b;
	return ans;
}

int div(int a0,int b0)
{
	int sign = (((a ^ b) >>31) & 0x01);
	long long int a = abs(a0);
	long long int b = abs(b0);
	int ans = 0;
	while(a >=b)
	{
		for(int c = b,i=0;c<=a;i++)
		{
			ans + = (1 << i);
			c = (c << i);
			a -= c;
		}
	}
	return sign?-ans:ans;
}

int main(int argc, char const *argv[])
{
	/* code */
	return 0;
}
